import { 
    reqGetBaseCategoryList,
    reqGetBannerList,
    reqGetFloorList 
} from '@/api/index';

let state = {
    baseCategoryList: [],
    bannerList:[],
    floorList:[]
};

let mutations = {
    BASE_CATEGORY_LIST(state, baseCategoryList) {
        state.baseCategoryList = baseCategoryList;
    },
    BANNER_LIST(state,bannerList){
        state.bannerList=bannerList;
    },
    FLOOR_LIST(state,floorList){
        state.floorList=floorList;
    }
};
let actions = {
    async actionApiBaseCategoryList({ commit }) {
        let r = await reqGetBaseCategoryList();
        commit('BASE_CATEGORY_LIST', r.data);
    },
    async actionApiBannerList({commit}){
        let r = await reqGetBannerList();
        commit('BANNER_LIST', r.data);
    },
    async actionApiFloorList({commit}){
        let r = await reqGetFloorList();
        commit('FLOOR_LIST', r.data);
    }
};
let getters = {};

export default {
    state,
    mutations,
    actions,
    getters
}